package com.sxj.corejava.code07_面向对象.继承;

/**
 * @author 石小俊
 * @date 2025年07月21日 10:57
 */
public class MotorVehicle {
    private String no;  // 车牌号
    private String brand;   // 品牌

    protected void show() {
        System.out.println("这是父类机动车的方法");
    }

    public String getNo() {
        return no;
    }

    public void setNo(String no) {
        this.no = no;
    }

    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }
}

class Car extends MotorVehicle {
    private String type;    // 车型

    public void show() {
        System.out.println("这是子类轿车的方法");
    }

    public void show(int i) {
        System.out.println("这是子类轿车的方法");
    }


    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }
}

class Bus extends MotorVehicle {
    private int seatCount;  // 座位数

    public void show() {
        System.out.println("这是子类大巴车的方法");
    }

    public int getSeatCount() {
        return seatCount;
    }

    public void setSeatCount(int seatCount) {
        this.seatCount = seatCount;
    }
}
